package com.cq.hd.product.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.product.api.dto.ReceiveRedPacketDto;
import com.cq.hd.product.api.dto.RedPacketStatisticsDto;
import com.cq.hd.product.api.vo.ActiveRedPacketVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "hd-o2o-product-service", contextId = "active-red-packet-api")
public interface TbActiveRedPacketApi {

    // 领取红包
    @PostMapping("/product/activeRedPacket/receive")
    Result<Boolean> receive(@RequestBody ReceiveRedPacketDto receiveRedPacketDto);

    // 红包中心的红包明细分页列表
    @GetMapping("/product/activeRedPacket/pageValidRedPacket")
    Result<Page<ActiveRedPacketVo>> pageValidRedPacket(@SpringQueryMap RedPacketStatisticsDto redPacketStatisticsDto);
}
